﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Administrator/EHTAdmin.Master" AutoEventWireup="true" CodeBehind="EHTProducts.aspx.cs" Inherits="EHTWebsiteProject.Administrator.EHTProducts" %>
<%@ Register src="Controls/PaggingControl.ascx" tagname="PaggingControl" tagprefix="uc1" %>
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="MenuModulContent" runat="server">
       <div class="MenuSub-Left" >
        <table>
            <tr>
                <td> <img alt="" src="../images/EHTgiaodien/icon-48-category.png" width="48px" height="48px" /></td>               
                <td><asp:Label ID="lbProduct" runat="server" Text="Quản lý sản phẩm " ></asp:Label></td>                
            </tr>
        </table>           
    </div>
    <div class="MenuSub-Right" align="right">
        <table style="height:60px">
            <tr>                               
                <td valign="middle">
                    <div class="add-edit-del">  
                            <asp:ImageButton ID="ImaTat" 
                                ImageUrl="~/images/EHTgiaodien/icon-32-unpublish.png" runat="server" 
                                width="32px" height="32px" class="imagboder" onclick="ImaTat_Click"  />                     
                            <br />
                            <asp:Label ID="lbTat" runat="server" Text="Tắt"></asp:Label>                       
                    </div>
                </td>
                <td valign="middle">
                    <div class="add-edit-del">   
                            <asp:ImageButton ID="ImgBat" 
                                ImageUrl="~/images/EHTgiaodien/icon-32-publish.png" runat="server" width="32px" 
                                height="32px" class="imagboder" onclick="ImgBat_Click"  />                     
                            <br />                                                 
                            <asp:Label ID="lbBat" runat="server" Text="Bật"></asp:Label>                       
                    </div>
                </td>                                             
                <td valign="middle">
                    <div class="add-edit-del">
                         <asp:ImageButton ID="ImgDel" ImageUrl="~/images/EHTgiaodien/icon-32-delete.png" 
                                runat="server" width="32px" height="32px" CssClass="imagboder" 
                                OnClientClick="return confirm('Are you sure you want to delete?');" 
                             onclick="ImgDel_Click" />                                                     
                            <br />
                            <asp:Label ID="lbDel" runat="server" Text="Xóa"></asp:Label>       
                    </div>
                </td>

                <td valign="middle">
                    <div class="add-edit-del">
                         <asp:ImageButton ID="ImgEdit" ImageUrl="~/images/EHTgiaodien/icon-32-edit.png" 
                                runat="server" width="32px" height="32px" CssClass="imagboder" onclick="ImgEdit_Click" 
                                />  <br />                                                                      
                            <asp:Label ID="lbEdit" runat="server" Text="Sửa"></asp:Label> 
                    </div>
                </td>
                <td valign="middle">
                    <div class="add-edit-del">
                        <a href="EHTProductUI.aspx">
                            <img alt="" src="../images/EHTgiaodien/icon-32-new.png" width="32px" height="32px" class="imagboder" /><br />
                            <asp:Label ID="lbAddNew" runat="server" Text="Thêm mới"></asp:Label>
                        </a>
                    </div>
                </td>
                 <td valign="middle">
                    <div class="add-edit-del">   
                            <asp:ImageButton ID="ImgCauHinh" 
                                ImageUrl="~/images/EHTgiaodien/icon-32-config.png" runat="server" width="32px" 
                                height="32px" class="imagboder" onclick="ImgCauHinh_Click"   />                     
                            <br />                                                 
                            <asp:Label ID="lbCauHinh" runat="server" Text="Cấu hình"></asp:Label>                       
                    </div>
                </td>    
                 <td valign="middle">
                    <div class="add-edit-del">
                        <a href="#">
                            <img alt="" src="../images/EHTgiaodien/icon-32-help.png" width="32px" height="32px" class="imagboder" /><br />
                            <asp:Label ID="lbHelp" runat="server" Text="Trợ giúp"></asp:Label>
                        </a>
                    </div>
                </td>                
            </tr>
        </table>
    </div>
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="ContentMain" runat="server">
    <div style="padding:0px 0px 0px 0px" align="right">
    <div style="padding:0px 0px 0px 0px" align="left">
        <div class="SanPham" >
            <a href="EHTProducts.aspx">
                <asp:Label ID="lbProducts" runat="server" ></asp:Label>
            </a>
        </div>
        <div class="SanPham">
           <a href="EHTCategory.aspx">
             <asp:Label ID="lbCategory" runat="server" ></asp:Label>
           </a>
        </div>
    </div>
        <table>
            <tr>
               <td>
               
               </td>               
                <td>
                    <asp:DropDownList ID="ddlDanhmucSanPham" runat="server" CssClass="InputText" 
                        Width="250px" AutoPostBack="true" 
                        onselectedindexchanged="ddlDanhmucSanPham_SelectedIndexChanged">
                    </asp:DropDownList>
                </td>
                 <td>
                    <asp:TextBox ID="txtsearch" runat="server" CssClass="InputText" Width="150px"></asp:TextBox> 
                &nbsp;</td>
                <td>
                    <asp:ImageButton ID="ImagSearch" runat="server" 
                        ImageUrl="~/images/EHTgiaodien/icon-16-orphan.png" Width="20px" Height="20px" 
                        onclick="ImagSearch_Click"/>
                &nbsp;&nbsp;&nbsp;
                </td>
            </tr>
        </table>
    </div>
    <asp:Literal ID="ltrErorr" runat="server"></asp:Literal>
    <div style="padding-top:5px;">
        <asp:Panel ID="pnSanPham" runat="server">
             <asp:Repeater ID="rpProducts" runat="server" 
            onitemdatabound="rpProducts_ItemDataBound" 
            onitemcommand="rpProducts_ItemCommand" >           
        <HeaderTemplate>
            <table ID="table" border="0" cellpadding="0" cellspacing="0" >
                 <thead>
                    <tr>
                                     <th>
                                        <asp:CheckBox ID="ckAll" runat="server" AutoPostBack="true" OnCheckedChanged="CheckAll" />
                                    </th>                       
                                   
                                    <th>
                                        <asp:Label ID="lbID" runat="server" Text="STT"></asp:Label>
                                    </th>
                                    <th>
                                        <asp:Label ID="lbTenSanPhamVN" runat="server" Text=" Tên sản phẩm"></asp:Label>                            
                                    </th>                                  
                                    <th>
                                        <asp:Label ID="lbHinhanh" runat="server" Text=" Hình ảnh "></asp:Label>                             
                                    </th>   
                                     <th>
                                        <asp:Label ID="lnMaSku" runat="server" Text=" Sku "></asp:Label>                             
                                    </th> 
                                     <th>
                                        <asp:Label ID="lbPrice" runat="server" Text=" Giá "></asp:Label>                             
                                    </th>  
                                    <th>
                                        <asp:Label ID="lbPublish" runat="server" Text=" Trạng thái "></asp:Label>                             
                                    </th>  
                                    <th>
                                        <asp:Label ID="lbDanhMuc" runat="server" Text=" Danh mục sản phẩm "></asp:Label>                             
                                    </th> 
                                    <th>
                                        <asp:Label ID="lbLuotXem" runat="server" Text=" Lượt Xem "></asp:Label>                             
                                    </th>  
                                     <th>
                                        <asp:Label ID="lbThuTu" runat="server" Text=" Thứ Tự "></asp:Label> 
                                        <asp:ImageButton ID="ibtnSaveAll" ImageUrl="~/images/save_all.jpg" Height="20"
                                        Width="20" OnClientClick="return confirm('Bạn muốn lưu ?');" runat="server" BorderStyle="None"
                                        CommandName="save_all" />                            
                                    </th>  
                                     <th>
                                        <asp:Label ID="lbNgayTao" runat="server" Text=" Ngày Tạo "></asp:Label>                             
                                    </th>                                                                         
                                                                               
                    </tr>
                 </thead>
                 <tbody>            
        </HeaderTemplate>
        <ItemTemplate>
                 <tr>
                        <td>
                            <asp:CheckBox ID="ckMenu"  runat="server" />
                            <asp:Label ID="lbDelID" runat="server" Visible="false" Text='<%#Eval("SanPhamID")%>'></asp:Label>
                        </td>
                        <td>
                            <%#Eval("IndexId") %>
                        </td>
                         <%if (IsVN)
                              { %> 
                                <td style="width:300px">
                                    <a class="a" href='EHTProductUI.aspx?ProductID=<%#Eval("SanPhamID") %>'>
                                        <%#Eval("TenSanPhamVN")%>
                                    </a>
                                </td>                                                                                                
                              <%}
                          else
                              {%>
                              <td style="width:300px">
                                    <a class="a" href='EHTProductUI.aspx?ProductID=<%#Eval("SanPhamID") %>'>
                                        <%#Eval("TenSanPhamOther")%>
                                    </a>
                                </td>                                  
                                                                                          
                              <%}
                         %>  
                                <td>
                                   <img  alt="" src='../ImageDatas/Products/<%#Eval("HinhAnhUrl")%>' width="80px" height="60px"/>
                                </td>
                                <td>
                                    <%#Eval("MaSku")%>
                                </td>
                                <td>
                                    <%#String.Format(DataBinder.Eval(Container.DataItem, "DonGia", "{0:0,0}"))%>
                                </td> 
                                <td>
                                     <asp:Label ID="lbStatus" runat="server" Text='<%#Eval("Publish")%>' Visible="false"></asp:Label>
                                     <asp:Image ID="ImagStatus" ImageUrl="~/images/tick.png" runat="server" />
                                </td>
                                <%if (IsVN)
                              { %> 
                                                               
                                <td style="width:150px">
                                    <%#Eval("TenDanhMucVN")%>
                                </td>                                                                    
                              <%}
                          else
                              {%>                             
                                <td style="width:150px">
                                    <%#Eval("TenDanhMucOther")%>
                                </td>    
                                                                                          
                              <%}
                         %>  
                          <td>
                            <%#Eval("LuotXem")%>
                         </td> 
                          <td style="width:100px">
                                     <asp:TextBox ID="txtNumberOfOrder" Width="30" runat="server" Text='<%#Eval("SapXep")%>'></asp:TextBox>
                    <asp:ImageButton Width="16" Height="16" ID="btnSaveNumberOfOrder" CommandName="change_number_of_order"
                        CommandArgument='<%#Eval("SanPhamID") %>' ImageUrl="~/images/save.jpg" runat="server" />
                                </td>   
                         <td>
                            <%#DataBinder.Eval(Container.DataItem, "NgayTao", "{0:d/M/yy}")%>
                         </td>                                       
                    </tr>
        </ItemTemplate>
        <FooterTemplate>
                </tbody>
             </table>
        </FooterTemplate>
    </asp:Repeater>
        </asp:Panel>
    </div> 
    <asp:Panel ID="pnSanPhamOther" runat="server">
         <asp:Repeater ID="rpProductsOther" runat="server" 
            onitemdatabound="rpProductsOther_ItemDataBound" 
            onitemcommand="rpProductsOther_ItemCommand" >           
        <HeaderTemplate>
            <table ID="table" border="0" cellpadding="0" cellspacing="0" >
                 <thead>
                    <tr>
                                     <th>
                                        <asp:CheckBox ID="ckAll" runat="server" AutoPostBack="true" OnCheckedChanged="CheckAll" />
                                    </th>                       
                                   
                                    <th>
                                        <asp:Label ID="lbID" runat="server" Text="Number Order"></asp:Label>
                                    </th>
                                    <th>
                                        <asp:Label ID="lbTenSanPhamVN" runat="server" Text=" Product Name"></asp:Label>                            
                                    </th>                                  
                                    <th>
                                        <asp:Label ID="lbHinhanh" runat="server" Text=" Image "></asp:Label>                             
                                    </th>   
                                     <th>
                                        <asp:Label ID="lnMaSku" runat="server" Text=" Sku "></asp:Label>                             
                                    </th> 
                                     <th>
                                        <asp:Label ID="lbPrice" runat="server" Text=" Price "></asp:Label>                             
                                    </th>  
                                    <th>
                                        <asp:Label ID="lbPublish" runat="server" Text=" Status "></asp:Label>                             
                                    </th>  
                                    <th>
                                        <asp:Label ID="lbDanhMuc" runat="server" Text=" Category Product "></asp:Label>                             
                                    </th> 
                                    <th>
                                        <asp:Label ID="lbLuotXem" runat="server" Text=" Views "></asp:Label>                             
                                    </th>  
                                     <th>
                                        <asp:Label ID="lbThuTu" runat="server" Text=" Order "></asp:Label> 
                                        <asp:ImageButton ID="ibtnSaveAll" ImageUrl="~/images/save_all.jpg" Height="20"
                                        Width="20" OnClientClick="return confirm('Bạn muốn lưu ?');" runat="server" BorderStyle="None"
                                        CommandName="save_all" />                            
                                    </th>  
                                     <th>
                                        <asp:Label ID="lbNgayTao" runat="server" Text=" Create Date "></asp:Label>                             
                                    </th>                                                                         
                                                                               
                    </tr>
                 </thead>
                 <tbody>            
        </HeaderTemplate>
        <ItemTemplate>
                 <tr>
                        <td>
                            <asp:CheckBox ID="ckMenu"  runat="server" />
                            <asp:Label ID="lbDelID" runat="server" Visible="false" Text='<%#Eval("SanPhamID")%>'></asp:Label>
                        </td>
                        <td>
                            <%#Eval("IndexId") %>
                        </td>
                      
                                <td style="width:300px">
                                    <a class="a" href='EHTProductUI.aspx?ProductID=<%#Eval("SanPhamID") %>'>
                                        <%#Eval("TenSanPhamVN")%>
                                    </a>
                                </td>                                                                                                
                             
                                <td>
                                   <img  alt="" src='../ImageDatas/Products/<%#Eval("HinhAnhUrl")%>' width="80px" height="60px"/>
                                </td>
                                <td>
                                    <%#Eval("MaSku")%>
                                </td>
                                <td>
                                    <%#String.Format(DataBinder.Eval(Container.DataItem, "DonGia", "{0:0,0}"))%>
                                </td> 
                                <td>
                                     <asp:Label ID="lbStatus" runat="server" Text='<%#Eval("Publish")%>' Visible="false"></asp:Label>
                                     <asp:Image ID="ImagStatus" ImageUrl="~/images/tick.png" runat="server" />
                                </td>
                        
                                                   
                                <td style="width:150px">
                                    <%#Eval("TenDanhMucOther")%>
                                </td>    
                                                                                          
                        
                          <td>
                            <%#Eval("LuotXem")%>
                         </td> 
                          <td style="width:100px">
                                     <asp:TextBox ID="txtNumberOfOrder" Width="30" runat="server" Text='<%#Eval("SapXep")%>'></asp:TextBox>
                    <asp:ImageButton Width="16" Height="16" ID="btnSaveNumberOfOrder" CommandName="change_number_of_order"
                        CommandArgument='<%#Eval("SanPhamID") %>' ImageUrl="~/images/save.jpg" runat="server" />
                                </td>   
                         <td>
                            <%#DataBinder.Eval(Container.DataItem, "NgayTao", "{0:d/M/yy}")%>
                         </td>                                       
                    </tr>
        </ItemTemplate>
        <FooterTemplate>
                </tbody>
             </table>
        </FooterTemplate>
    </asp:Repeater>
    </asp:Panel>
    <div align="center" style="padding:10px 0px 10px 0px">        
        <table>
            <tr>
                <td valign="top">
                    <asp:Label ID="lbHienThi" runat="server" Text="Hiển thị" ></asp:Label>
                    <asp:DropDownList ID="ddlSize" runat="server" AutoPostBack="true" 
                        onselectedindexchanged="ddlSize_SelectedIndexChanged">
                        <asp:ListItem Value="5" Text="5"></asp:ListItem>
                        <asp:ListItem Value="10" Text="10"></asp:ListItem>
                        <asp:ListItem Value="20" Text="20"></asp:ListItem>
                        <asp:ListItem Value="30" Text="30"></asp:ListItem>
                        <asp:ListItem Value="50" Text="50"></asp:ListItem>
                        <asp:ListItem Value="100" Text="100"></asp:ListItem>
                        <asp:ListItem Value="-1" Text="all"></asp:ListItem>
                    </asp:DropDownList>
                </td>
                <td>
                    <uc1:PaggingControl ID="PaggingControl1" PageSize="30" runat="server" />
                </td>
            </tr>
        </table>
        
    </div>  
</asp:Content>
